<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of welcome
 *
 * @author Obi
 */
class Admin_pengiriman_produk extends MY_Controller {

    function __construct() {
        parent::__construct();

        $cek_admin = $this->session->userdata('cek_admin');
        if (!$cek_admin)
            redirect("admin");

        $this->mpemesanan = new M_pemesanan();
        $this->mpemesanandet = new M_pemesanan_det();
    }

    function index() {

        $data['title'] = 'Data Pengiriman Produk';

        $data['isi'] = 'isi';
        $data['list_pemesanan'] = $this->mpemesanan->select_data_kirim();
        $this->load->view('template_admin', $data);
    }

    function view_det($id = NULL) {

        $data['title'] = 'Daftar Data Transaksi';

        $data['list_data'] = $this->mpemesanan->select_data_det($id);
        $data['list_data_det'] = $this->mpemesanandet->detail_data($id);
        $data['isi'] = 'isi_det';
        $this->load->view('template_admin', $data);
    }

    function update_pengiriman() {

        $id = $this->input->post('id_transaksi');
        $data = array(
            'nomer_pengiriman' => $this->input->post('nomer_pengiriman'),
            'status_pengiriman' => 1,
            'tgl_pengiriman' => $this->input->post('tgl_kirim'),
        );

        $this->mpemesanan->update($data, $id);

        $this->index();
    }

}

?>
